//
//  YDOARefuceResonVCViewController.swift
//  YDOAProduct
//
//  Created by 占益民 on 2017/11/15.
//  Copyright © 2017年 Allen. All rights reserved.
//

import UIKit
import Toaster
class YDOARefuceResonVCViewController: UIViewController {

    var placeHolderStr : String? = "请输入拒绝理由"
    var callBack : ((_ str : String) -> Swift.Void)? = nil
    
    @IBOutlet weak var refuseResonTF: UITextField!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        refuseResonTF.placeholder = placeHolderStr
        
    }
    @IBAction func sureClick(_ sender: Any) {
        
        if refuseResonTF != nil  && refuseResonTF.text != "" {
            callBack!(refuseResonTF.text!)
            self.dismiss(animated: true) {
                
            }
        }else{
            Toast(text: "\(placeHolderStr ?? "请填写拒绝理由")", delay: 0, duration: 1.5).show()
        }
    }
    @IBAction func closeClick(_ sender: Any) {
        self.dismiss(animated: true) { 
            
        }
    }
    
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        view.endEditing(true)
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
